import {
	post
} from "@/utils/http"

/**
 * @description 获取订单列表
 */
export const getOrderList = () => {
	return post('/order/list', {})
}

/**
 * @description 获取订单详情
 */
export const getOrderDetail = (id) => {
	return post('/order/detail', { id })
}

/**
 * @description 获取域名列表
 */
export const getCertificatesDomains = (orderNo) => {
	return post('/order/certificates/domains', { orderNo })
}

/**
 * @description 验证域名
 */
export const certificatesVerifyDomains = (id, orderNo) => {
	return post('/order/certificates/verifyDomains', { id, orderNo }, 3)
}
/**
 * @description 下载
 */
export const certificatesDownload = (id) => {
	return post('/order/certificates/download', { id })
}

/**
 * @description 创建订单
 * @param { object} data
 */
export const createOrder = (data) => {
	return post('/order/create', data)
}

/**
 * @description 取消支付
 * @param { object} data
 */
export const cancelPay = (id) => {
	return post('/order/cancelPay', { id })
}